
 
 F u n c t i o n :   s e t K e y b o a r d A 1 1 Y ( d o m E l e m e n t O r C S S S e l e c t o r ,   s t r i n g R o l e ,   s t r i n g N a m e ,   b o o l N o S p a c e b a r ,   f n O p t i o n a l C l i c k H a n d l e r ) 
 
 
 
 S h o r t h a n d :   s e t K B A 1 1 Y ( d o m E l e m e n t O r C S S S e l e c t o r ,   s t r i n g R o l e ,   s t r i n g N a m e ,   b o o l N o S p a c e b a r ,   f n O p t i o n a l C l i c k H a n d l e r ) 
 
 
 
 D e s c r i p t i o n :   W i l l   a u t o m a t i c a l l y   a d d   k e y b o a r d   a n d   s c r e e n   r e a d e r   a c c e s s i b l e   a t t r i b u t e s   a n d   e v e n t s   t o   n o n - f o c u s a b l e   s i m u l a t e d   a c t i v e   e l e m e n t s   t h a t   a r e   n o t   a l r e a d y   a c c e s s i b l e . 
 
 
 
 R e t u r n s :   d o m E l e m e n t   o r   a r r a y   o f   d o m E l e m e n t s   i f   a p p l i c a b l e ,   o r   $ A   o b j e c t   i f   c h a i n e d . 
 
 
 
 N o t e :   I f   t h i s   f u n c t i o n   i s   r u n   o n   n a t i v e   a c t i v e   e l e m e n t s   s u c h   a s   b u t t o n s   o r   l i n k s ,   n a t i v e   f o r m   f i e l d s ,   o r   e l e m e n t s   t h a t   a r e   a l r e a d y   k e y b o a r d   a c c e s s i b l e ,   i t   w i l l   d o   n o t h i n g .   T h e   p u r p o s e   o f   t h i s   f u n c t i o n   i s   t o   a d d   k e y b o a r d   a n d   s c r e e n   r e a d e r   a c c e s s i b i l i t y   w h e r e   p r e s e n t l y   t h e r e   i s   n o n e . 
 
 
 
 E x a m p l e : 
 
 
 
 / /   A d d   k e y b o a r d   a n d   s c r e e n   r e a d e r   a c c e s s i b i l i t y   t o   t h e   f o l l o w i n g   c l i c k a b l e   i c o n   f r o m   F o n t   A w e s o m e : 
 
 / /   < i   c l a s s = " f a s f a - c o f f e e  f a - x s " > < / i > 
 
 
 
 $ A . s e t K e y b o a r d A 1 1 Y ( " i . f a s f a - c o f f e e . f a - x s " ,   " b u t t o n " ,   " S h o w   m e   h o w   t o   m a k e   a   c u p   o f   c o f f e e ! " ) ; 
 
 
 
 / /   O r   t h e   s a m e   b y   s h o r t e n i n g   t h e   p a r a m e t e r s   l i s t   w h e n   t h e   e l e m e n t   a l r e a d y   h a s   a   n a m e . 
 
 / /   E . G .   F o r   < s p a n   c l a s s = " b u t t o n " > S e t t i n g s < / s p a n > 
 
 
 
 $ A . s e t K e y b o a r d A 1 1 Y ( " s p a n . b u t t o n " ,   " b u t t o n " ,   f u n c t i o n ( e v )   { 
 
     a l e r t ( " D o   s o m e t h i n g   w h e n   c l i c k e d ! " ) ; 
 
 } ) ; 
 
 
 
 / /   O r   t h e   s a m e   u s i n g   c h a i n i n g 
 
 
 
 v a r   m y C h a i n   =   $ A ( " i . f a s f a - c o f f e e . f a - x s " ) . s e t K e y b o a r d A 1 1 Y ( " b u t t o n " ,   " S h o w   m e   h o w   t o   m a k e   a   c u p   o f   c o f f e e ! " ) ; 
 
 
 
 / /   O r   t h e   s a m e   b y   s h o r t e n i n g   t h e   p a r a m e t e r s   l i s t   w h e n   t h e   e l e m e n t   a l r e a d y   h a s   a   n a m e . 
 
 / /   E . G .   F o r   < s p a n   c l a s s = " b u t t o n " > S e t t i n g s < / s p a n > 
 
 
 
 v a r   m y C h a i n   =   $ A ( " s p a n . b u t t o n " ) . s e t K e y b o a r d A 1 1 Y ( " b u t t o n " ,   f u n c t i o n ( e v )   { 
 
     a l e r t ( " D o   s o m e t h i n g   w h e n   c l i c k e d ! " ) ; 
 
 } ) ; 
 
 
 
 / /   T o   r e t u r n   t h e   m o d i f i e d   o b j e c t   w i t h i n   a   c h a i n ,   u s e   t h e   " r e t u r n ( ) "   m e t h o d . 
 
 
 
 v a r   m y O b j e c t   =   m y C h a i n . r e t u r n ( ) ; 
 
 